package ma.platform.server.upms.rpc;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import jakarta.annotation.Resource;
import ma.platform.server.core.util.R;
import ma.platform.server.upms.api.entity.SysDictItem;
import ma.platform.server.upms.api.rpc.RemoteDictService;
import ma.platform.server.upms.service.SysDictItemService;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * Copyright:
 * Author:
 * Description:
 * Created by 李林山 on 2024/8/18
 */
@Component
public class RemoteDictServiceImpl implements RemoteDictService {

    @Resource
    private SysDictItemService sysDictItemService;

    @Override
    public R<List<SysDictItem>> getDictByType(String type) {
        return R.ok(sysDictItemService.list(Wrappers.<SysDictItem>query().lambda().eq(SysDictItem::getDictType, type)));
    }
}
